//
//  NewsCell.m
//  Movie
//
//  Created by tengyang on 15/7/21.
//  Copyright (c) 2015年 tengyang. All rights reserved.
//

#import "NewsCell.h"
#import "UIImageView+WebCache.h"
@implementation NewsCell

- (void)awakeFromNib {
    // Initialization code
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

   
}

- (void)setModal:(NewsModal *)modal
{
    _modal=modal;
    [self setNeedsLayout];
}

- (void)layoutSubviews
{
    //记住一定要加[super layoutSubviews]，不然会出现cell复用的错误
    [super layoutSubviews];
    //self.backgroundColor=[UIColor blackColor];
    if (_modal.type==1) {
        _typeImageView.image=[UIImage imageNamed:@"sctpxw"];
    }
    if (_modal.type==2)
    {
        
        _typeImageView.image=[UIImage imageNamed:@"scspxw"];
        
    }

    _titleLable.text=_modal.title;
    _summaryLable.text=_modal.summary;
    NSString *temp=_modal.image;
    [_iconImageView sd_setImageWithURL:[NSURL URLWithString:temp]];
    
    
    
}
@end
